package chapter_3;

public class Test8 {
    public static void main(String[] args) {
        //1
        //1 1
        //1 2 1
        //1 3 3 1
        //1 4 6 4 1
        //1 5 10 10 5 1
        int[][] arr = new int[6][];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = new int[i+1];
        }
        arr[0][0] = 1;
        for (int i = 1; i < arr.length; i++) {
            arr[i][0] = 1;
            for (int j = 1; j < arr[i].length -1; j++) {
                arr[i][j] = arr[i-1][j-1] +arr[i-1][j];
            }
            arr[i][arr[i].length-1] = 1;
        }
        for (int[] ints : arr) {
            for (int anInt : ints) {
                System.out.print(anInt+" ");
            }
            System.out.println();
        }
    }
}
